package com.zhentao.controller;

import com.zhentao.domain.dto.UserListDto;
import com.zhentao.service.UserService;
import com.zhentao.until.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;


    @PostMapping("findAll")
    public ResponseResult findAll(@RequestBody UserListDto dto){
        return userService.findAll(dto);
    }


    @DeleteMapping("/delete/{id}")
    public ResponseResult delete(@PathVariable("id") Integer id){
         userService.removeById(id);
         return ResponseResult.okResult("删除成功");
    }
}
